<!--
 * createor: zc
 * email: zc8023zs@163.com
 * create_time: 2020/3/14 13:46:24
 *-->
<template>
  <el-container>
    <el-header>
      门店商品详情
    </el-header>
    <el-main>
      <el-form label-width="200px" :inline="true" style="padding:5% 5% 0 5%">
        <el-form-item label="标识id：">
          <span>{{formData.order_goods_id}}</span>
        </el-form-item>
        <el-form-item label="标识id：">
          <span>{{formData.order_id}}</span>
        </el-form-item>
        <el-form-item label="商品id：">
          <span>{{formData.goods_id}}</span>
        </el-form-item>
        <el-form-item label="运营中心id：">
          <span>{{formData.oc_id}}</span>
        </el-form-item>
        <el-form-item label="店铺/门店id：">
          <span>{{formData.shop_id}}</span>
        </el-form-item>
        <el-form-item label="商品分类：">
          <span>{{formData.category_id}}</span>
        </el-form-item>
        <el-form-item label="商品名称：">
          <span>{{formData.name}}</span>
        </el-form-item>
        <el-form-item label="店铺logo：">
          <span>{{formData.logo}}</span>
        </el-form-item>
        <el-form-item label="最小购买量：">
          <span>{{formData.min_buy}}</span>
        </el-form-item>
        <el-form-item label="单位：">
          <span>{{formData.unit}}</span>
        </el-form-item>
        <el-form-item label="商品简介：">
          <span>{{formData.intro}}</span>
        </el-form-item>
        <el-form-item label="商品详情：">
          <span>{{formData.description}}</span>
        </el-form-item>
        <el-form-item label="商品标签：">
          <span>{{formData.tags}}</span>
        </el-form-item>
        <el-form-item label="创建时间：">
          <span>{{formData.create_time}}</span>
        </el-form-item>
        <el-form-item label="单点不配送：">
          <span>{{formData.unsend}}</span>
        </el-form-item>
        <el-form-item label="规格名称：">
          <span>{{formData.spec_name}}</span>
        </el-form-item>
        <el-form-item label="价格：">
          <span>{{formData.price}}</span>
        </el-form-item>
        <el-form-item label="原价：">
          <span>{{formData.original_price}}</span>
        </el-form-item>
        <el-form-item label="包装费：">
          <span>{{formData.package_price}}</span>
        </el-form-item>
        <el-form-item label="实时库存：">
          <span>{{formData.inventory}}</span>
        </el-form-item>
        <el-form-item label="最大库存：">
          <span>{{formData.maximum_inventory}}</span>
        </el-form-item>
        <el-form-item label="次日置满：">
          <span>{{formData.fill_morrow}}</span>
        </el-form-item>
        <el-form-item label="重量(g)：">
          <span>{{formData.weight}}</span>
        </el-form-item>
        <el-form-item label="数据版本字段：">
          <span>{{formData.version_id}}</span>
        </el-form-item>
      </el-form>
    </el-main>
  </el-container>
</template>
<style scoped>
body .app-container .el-container,
body .app-container .el-header,
body .app-container .el-main,
body .el-container,
body .el-header,
body .el-main {
  padding: 0;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
</style>
<script>
import { Loading } from "element-ui";
import {
  qr_order_takeout_goodsInfo
} from '@/api/project/wmyw/project_wmyw_qr_order_takeout_goods'
export default {
  name: "a_wmywa_qr_order_takeout_goods_info",
  data() {
    return {
      infoLoading: false,
      formData:{
        order_goods_id: 0, 
        order_id: 0, 
        goods_id: 0, 
        oc_id: 0, 
        shop_id: 0, 
        category_id: 0, 
        name: '', 
        logo: '', 
        min_buy: 0, 
        unit: '', 
        intro: '', 
        description: '', 
        tags: '', 
        create_time: '2020/8/11 15:00:33', 
        unsend: 0, 
        spec_name: '', 
        price: 0.0, 
        original_price: 0.0, 
        package_price: 0.0, 
        inventory: 0, 
        maximum_inventory: 0, 
        fill_morrow: 0, 
        weight: 0, 
        version_id: 0, 
      }
    };
  },
  activated() {
    var result = location.search.match(new RegExp("[\?\&]id=([^\&]+)", "i"));
    if(result != null || result.length > 0){
      this.onInfo(result[1]);
    }
  },
  methods: {
    onInfo(id){
      this.infoLoading=true;
      qr_order_takeout_goodsInfo({id:id}).then(r=>{
        this.formData.order_goods_id = r.dataSingle.order_goods_id, 
        this.formData.order_id = r.dataSingle.order_id, 
        this.formData.goods_id = r.dataSingle.goods_id, 
        this.formData.oc_id = r.dataSingle.oc_id, 
        this.formData.shop_id = r.dataSingle.shop_id, 
        this.formData.category_id = r.dataSingle.category_id, 
        this.formData.name = r.dataSingle.name, 
        this.formData.logo = r.dataSingle.logo, 
        this.formData.min_buy = r.dataSingle.min_buy, 
        this.formData.unit = r.dataSingle.unit, 
        this.formData.intro = r.dataSingle.intro, 
        this.formData.description = r.dataSingle.description, 
        this.formData.tags = r.dataSingle.tags, 
        this.formData.create_time = r.dataSingle.create_time, 
        this.formData.unsend = r.dataSingle.unsend, 
        this.formData.spec_name = r.dataSingle.spec_name, 
        this.formData.price = r.dataSingle.price, 
        this.formData.original_price = r.dataSingle.original_price, 
        this.formData.package_price = r.dataSingle.package_price, 
        this.formData.inventory = r.dataSingle.inventory, 
        this.formData.maximum_inventory = r.dataSingle.maximum_inventory, 
        this.formData.fill_morrow = r.dataSingle.fill_morrow, 
        this.formData.weight = r.dataSingle.weight, 
        this.formData.version_id = r.dataSingle.version_id, 
        this.infoLoading=false;
      }).catch(()=>{
        this.infoLoading=false;
      });
    }
  }
}
</script>
